<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of working_papers
 */
include_once dirname(dirname(dirname(__FILE__))) . '/shared/db_connection.php';
include_once dirname(dirname(dirname(__FILE__))) . '/shared/common.php';

class working_papers {

    //attributes
    public $paper_id;
    public $title;
    public $author;
    public $citation;
    public $keywords;
    public $article_type;
    public $pages;
    public $doi;
    public $publisher;
    public $acknowlegdements;
    public $abstract;
    public $pdf_files;
    public $dated;
    public $date_by_user;
    public $journal_id;

    //method
    public function __construct() {
        
    }

    public function get_all_papers() {
        $con = open_connect();

        $query = "CALL GetAllPapers()";
        $result = mysqli_query($con, $query) or die("Can't excute query");

        $list = array();
        while ($row = mysqli_fetch_array($result)) {
            array_push($list, $row);
        }

        close_connect($con);
        return $list;
    }

}
